package com.itheima.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ServletDemo3 extends HttpServlet {
    //代表对象出生的一个过程
    @Override
    public void init() throws ServletException {
        System.out.println("对象出生了");
    }


    //代表对象被服务的一个过程
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //super.doGet(req, resp);
        System.out.println("接收到了客户端请求");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }




    //代表对象被销毁的一个过程
    @Override
    public void destroy() {
        System.out.println("对象被销毁了");
    }
}
